﻿Public Class ucBuyingSelling
    Private _idFile As Integer
    Dim ucSelling As ucSellingRateOneFile = Nothing
    Dim ucBuying As ucBuyingRate = Nothing
    Private Sub ucBuyingSelling_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (ucBuying Is Nothing) Then
            ucBuying = New ucBuyingRate(_idFile)
            ucBuying.Dock = DockStyle.Fill
            SplitContainer1.Panel1.Controls.Add(ucBuying)
        End If
        If (ucSelling Is Nothing) Then
            ucSelling = New ucSellingRateOneFile(_idFile)
            ucSelling.Dock = DockStyle.Fill
        Else
            ucSelling.RefreshData()
        End If
        If (ucSelling.CoThongTin) Then
            SplitContainer1.Panel2.Controls.Add(ucSelling)
        Else
            SplitContainer1.Panel2Collapsed = True
        End If
    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub
    Public Sub New(ByVal idFile As Integer)

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        _idFile = idFile
    End Sub
End Class
